﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NetworkCrashSimulator
{
    class Help
    {
        /// <summary>
        /// Print the full help on the console screen.
        /// </summary>
        public static void ShowFull()
        {
            Header();
            Console.WriteLine(string.Empty);
            CommandExample();
            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);
            ListAdapter();
            Console.WriteLine(string.Empty);
            ThisScreen();
            Console.WriteLine(string.Empty);
            Crash();
            Console.WriteLine(string.Empty);
            Repair();
            Console.WriteLine(string.Empty);
            Timed();
            Console.WriteLine(string.Empty);
            Adapter();
            Console.WriteLine(string.Empty);
            Timers();
            Console.WriteLine(string.Empty);
            Footer();
        }

        private static void Header()
        {
            Console.WriteLine(string.Empty);
            Console.WriteLine("This application is designed to simulate network crashes in a selected");
            Console.WriteLine("period of time.");
        }

        private static void CommandExample()
        {
            Console.WriteLine("NetworkCrashSimulator.exe -ListAdapters | -Help |");
            Console.WriteLine("                          -Crash -Adapter=<Network Adapter Name> |");
            Console.WriteLine("                          -Repair -Adapter=<Network Adapter Name> |");
            Console.WriteLine("                          -Timed -Adapter=<Network Adapter Name>");
            Console.WriteLine("                                 -Timers=<Run Time>,<Crashes>,<Recovery Time>");
            Console.WriteLine(string.Empty);
            Console.WriteLine("The arguments should be passed in the same order as diplayed here.");
        }

        private static void ListAdapter()
        {
            Console.WriteLine("    -ListAdapters                 List all the available adapters in the");
            Console.WriteLine("                                  machine.");
        }

        private static void ThisScreen()
        {
            Console.WriteLine("    -Help                         Show this screen.");
        }

        private static void Crash()
        {
            Console.WriteLine("    -Crash                        Crash a specific network adapter.");
        }

        private static void Repair()
        {
            Console.WriteLine("    -Repair                       Repair a specific network adapter.");
        }

        private static void Timed()
        {
            Console.WriteLine("    -Timed                        Crash and repair a network adapter in a");
            Console.WriteLine("                                  space of time.");
        }

        private static void Adapter()
        {
            Console.WriteLine("    -Adapter                      Name of the nerwork adapter that will be");
            Console.WriteLine("                                  used, if the name have spaces it should be");
            Console.WriteLine("                                  passed using double quotes.");
        }

        private static void Timers()
        {
            Console.WriteLine("    -Timers                       Timers that will be used in the operation.");
            Console.WriteLine("                                  The timer values are separated from each");
            Console.WriteLine("                                  other using commas(,).");
            Console.WriteLine("                                  Tose timmers are:");
            Console.WriteLine(string.Empty);
            Console.WriteLine("      <Run Time>                  The complete time in minutes the application");
            Console.WriteLine("                                  will run.");
            Console.WriteLine(string.Empty);
            Console.WriteLine("      <Crashes>                   Whow many crashes the application will have");
            Console.WriteLine("                                  in the selcted time.");
            Console.WriteLine(string.Empty);
            Console.WriteLine("      <Recovery Time>             The time in seconds the adapter will take");
            Console.WriteLine("                                  to repair after each crash.");

        }

        private static void Footer()
        {
        }
    }
}
